package signalprocessing;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;

import ikelib.PlotColor;

/**
 * 
 */

/**
 * @author Toshiharu Ikeda <ikeda.104@gmail.com>
 *
 */
public class PlotPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	private PlotColor Col = null;
	
	public PlotPanel(PlotColor c){
		setPlotColor(c);
	}
	public void setPlotColor(PlotColor c){
		Col = c;
	}
	@Override
	public void paintComponent(Graphics g){
		//super.paintComponent(g);
		Dimension dm = this.getSize();
		Graphics2D g2 = (Graphics2D)g;
		if(Col!=null){
			g2.setBackground(Col.ColorBackGround);
			g2.setColor(Col.ColorAxis);
		}
		g2.clearRect(0,0,dm.width,dm.height);

	}
	
}
